home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / AppleGuide.p < prev    next >
Text File  |  1995-09-14  |  9KB  |  330 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 5:15:18 PM }
  2. {}
  3. {     File:        AppleGuide.p}
  4. { }
  5. {     Contains:    Apple Guide Interfaces.}
  6. { }
  7. {     Version:    Technology:    System 7.5}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit AppleGuide;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __APPLEGUIDE__}
  26. {$SETC __APPLEGUIDE__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, AppleTalk, Processes, PPCToolbox, EPPC, Notification, AppleEvents, Files;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35.     type
  36.         AGRefNum = UInt32;
  37.  
  38.         AGCoachRefNum = UInt32;
  39.  
  40.         AGContextRefNum = UInt32;
  41.  
  42.         AGAppInfo = record
  43.                 eventId: AEEventID;
  44.                 refCon: LONGINT;
  45.                 contextObj: Ptr;                                    { private system field}
  46.             end;
  47.  
  48.         AGAppInfoPtr = ^AGAppInfo;
  49.         AGAppInfoHdl = ^AGAppInfoPtr;
  50.  
  51.         CoachReplyProcPtr = ProcPtr;  { FUNCTION CoachReply(VAR pRect: Rect; name: Ptr; refCon: LONGINT): OSErr; }
  52.         ContextReplyProcPtr = ProcPtr;  { FUNCTION ContextReply(pInputData: Ptr; inputDataSize: Size; VAR ppOutputData: Ptr; VAR pOutputDataSize: Size; hAppInfo: AGAppInfoHdl): OSErr; }
  53.         CoachReplyUPP = UniversalProcPtr;
  54.         ContextReplyUPP = UniversalProcPtr;
  55.  
  56.     const
  57.         uppCoachReplyProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  58.         uppContextReplyProcInfo = $0000FFE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  59.  
  60.     function NewCoachReplyProc (userRoutine: CoachReplyProcPtr): CoachReplyUPP;
  61.     {$IFC NOT GENERATINGCFM }
  62.     inline
  63.         $2E9F;
  64.     {$ENDC}
  65.  
  66.     function NewContextReplyProc (userRoutine: ContextReplyProcPtr): ContextReplyUPP;
  67.     {$IFC NOT GENERATINGCFM }
  68.     inline
  69.         $2E9F;
  70.     {$ENDC}
  71.  
  72.     function CallCoachReplyProc (var pRect: Rect; name: Ptr; refCon: LONGINT; userRoutine: CoachReplyUPP): OSErr;
  73.     {$IFC NOT GENERATINGCFM}
  74.     inline
  75.         $205F, $4E90;
  76.     {$ENDC}
  77.  
  78.     function CallContextReplyProc (pInputData: Ptr; inputDataSize: Size; var ppOutputData: Ptr; var pOutputDataSize: Size; hAppInfo: AGAppInfoHdl; userRoutine: ContextReplyUPP): OSErr;
  79.     {$IFC NOT GENERATINGCFM}
  80.     inline
  81.         $205F, $4E90;
  82.     {$ENDC}
  83.  
  84.     const
  85.         gestaltAppleGuidePresent = 31;
  86.         gestaltAppleGuideIsDebug = 30;
  87.         kAGDefault = 0;
  88.         kAGFrontDatabase = 1;
  89.         kAGNoMixin = -1;
  90.  
  91.         kAGViewFullHowdy = 1;                            { Full-size Howdy}
  92.         kAGViewTopicAreas = 2;                            { Full-size Topic Areas}
  93.         kAGViewIndex = 3;                            { Full-size Index Terms}
  94.         kAGViewLookFor = 4;                            { Full-size Look-For (Search)}
  95.         kAGViewSingleHowdy = 5;                            { Single-list-size Howdy}
  96.         kAGViewSingleTopics = 6;                            { Single-list-size Topics}
  97.  
  98.         kAGFileMain = 'poco';
  99.         kAGFileMixin = 'mixn';
  100.  
  101. { To test against AGGetAvailableDBTypes}
  102.         kAGDBTypeBitAny = $00000001;
  103.         kAGDBTypeBitHelp = $00000002;
  104.         kAGDBTypeBitTutorial = $00000004;
  105.         kAGDBTypeBitShortcuts = $00000008;
  106.         kAGDBTypeBitAbout = $00000010;
  107.         kAGDBTypeBitOther = $00000080;
  108.  
  109.  
  110.     type
  111.         AGStatus = UInt16;
  112.  
  113. { Returned by AGGetStatus}
  114.  
  115.     const
  116.         kAGIsNotRunning = 0;
  117.         kAGIsSleeping = 1;
  118.         kAGIsActive = 2;
  119.  
  120.  
  121.     type
  122.         AGWindowKind = UInt16;
  123.  
  124. { Returned by AGGetFrontWindowKind}
  125.  
  126.     const
  127.         kAGNoWindow = 0;
  128.         kAGAccessWindow = 1;
  129.         kAGPresentationWindow = 2;
  130.  
  131. { Error Codes}
  132. { Not an enum, because other OSErrs are valid.}
  133.  
  134.     type
  135.         AGErr = SInt16;
  136.  
  137. { Apple Guide error codes}
  138.  
  139.     const
  140. { -------------------- Apple event reply codes}
  141.         kAGErrUnknownEvent = -2900;
  142.         kAGErrCantStartup = -2901;
  143.         kAGErrNoAccWin = -2902;
  144.         kAGErrNoPreWin = -2903;
  145.         kAGErrNoSequence = -2904;
  146.         kAGErrNotOopsSequence = -2905;
  147.         kAGErrReserved06 = -2906;
  148.         kAGErrNoPanel = -2907;
  149.         kAGErrContentNotFound = -2908;
  150.         kAGErrMissingString = -2909;
  151.         kAGErrInfoNotAvail = -2910;
  152.         kAGErrEventNotAvailable = -2911;
  153.         kAGErrCannotMakeCoach = -2912;
  154.         kAGErrSessionIDsNotMatch = -2913;
  155.         kAGErrMissingDatabaseSpec = -2914;
  156. { -------------------- Coach's Chalkboard reply codes}
  157.         kAGErrItemNotFound = -2925;
  158.         kAGErrBalloonResourceNotFound = -2926;
  159.         kAGErrChalkResourceNotFound = -2927;
  160.         kAGErrChdvResourceNotFound = -2928;
  161.         kAGErrAlreadyShowing = -2929;
  162.         kAGErrBalloonResourceSkip = -2930;
  163.         kAGErrItemNotVisible = -2931;
  164.         kAGErrReserved32 = -2932;
  165.         kAGErrNotFrontProcess = -2933;
  166.         kAGErrMacroResourceNotFound = -2934;
  167. { -------------------- API reply codes}
  168.         kAGErrAppleGuideNotAvailable = -2951;
  169.         kAGErrCannotInitCoach = -2952;
  170.         kAGErrCannotInitContext = -2953;
  171.         kAGErrCannotOpenAliasFile = -2954;
  172.         kAGErrNoAliasResource = -2955;
  173.         kAGErrDatabaseNotAvailable = -2956;
  174.         kAGErrDatabaseNotOpen = -2957;
  175.         kAGErrMissingAppInfoHdl = -2958;
  176.         kAGErrMissingContextObject = -2959;
  177.         kAGErrInvalidRefNum = -2960;
  178.         kAGErrDatabaseOpen = -2961;
  179.         kAGErrInsufficientMemory = -2962;
  180.  
  181. { Events}
  182. { Not an enum because we want to make assignments.}
  183.  
  184.     type
  185.         AGEvent = UInt32;
  186.  
  187. { Handy events for AGGeneral.}
  188.  
  189.     const
  190. { Panel actions (Require a presentation window).}
  191.         kAGEventDoCoach = 'doco';
  192.         kAGEventDoHuh = 'dhuh';
  193.         kAGEventGoNext = 'gonp';
  194.         kAGEventGoPrev = 'gopp';
  195.         kAGEventHidePanel = 'pahi';
  196.         kAGEventReturnBack = 'gobk';
  197.         kAGEventShowPanel = 'pash';
  198.         kAGEventTogglePanel = 'patg';
  199.  
  200. { Functions}
  201. { AGClose}
  202. { Close the database associated with the AGRefNum.}
  203.  
  204.     function AGClose (var refNum: AGRefNum): AGErr;
  205.     {$IFC NOT GENERATINGCFM}
  206.     inline
  207.         $7011, $AA6E;
  208.     {$ENDC}
  209. { AGGeneral}
  210. { Cause various events to happen.}
  211.     function AGGeneral (refNum: AGRefNum; theEvent: AGEvent): AGErr;
  212.     {$IFC NOT GENERATINGCFM}
  213.     inline
  214.         $700D, $AA6E;
  215.     {$ENDC}
  216. { AGGetAvailableDBTypes}
  217. { Return the database types available for this application.}
  218.     function AGGetAvailableDBTypes: UInt32;
  219.     {$IFC NOT GENERATINGCFM}
  220.     inline
  221.         $7008, $AA6E;
  222.     {$ENDC}
  223. { AGGetFrontWindowKind}
  224. { Return the kind of the front window.}
  225.     function AGGetFrontWindowKind (refNum: AGRefNum): AGWindowKind;
  226.     {$IFC NOT GENERATINGCFM}
  227.     inline
  228.         $700C, $AA6E;
  229.     {$ENDC}
  230. { AGGetFSSpec}
  231. { Return the FSSpec for the AGRefNum.}
  232.     function AGGetFSSpec (refNum: AGRefNum; var fileSpec: FSSpec): AGErr;
  233.     {$IFC NOT GENERATINGCFM}
  234.     inline
  235.         $700F, $AA6E;
  236.     {$ENDC}
  237. { AGGetStatus}
  238. { Return the status of Apple Guide.}
  239.     function AGGetStatus: AGStatus;
  240.     {$IFC NOT GENERATINGCFM}
  241.     inline
  242.         $7009, $AA6E;
  243.     {$ENDC}
  244. { AGInstallCoachHandler}
  245. { Install a Coach object location query handler.}
  246.     function AGInstallCoachHandler (coachReplyProc: CoachReplyUPP; refCon: LONGINT; var resultRefNum: AGCoachRefNum): AGErr;
  247.     {$IFC NOT GENERATINGCFM}
  248.     inline
  249.         $7012, $AA6E;
  250.     {$ENDC}
  251. { AGInstallContextHandler}
  252. { Install a context check query handler.}
  253.     function AGInstallContextHandler (contextReplyProc: ContextReplyUPP; eventID: AEEventID; refCon: LONGINT; var resultRefNum: AGContextRefNum): AGErr;
  254.     {$IFC NOT GENERATINGCFM}
  255.     inline
  256.         $7013, $AA6E;
  257.     {$ENDC}
  258. { AGIsDatabaseOpen}
  259. { Return true if the database associated with the AGRefNum is open.}
  260.     function AGIsDatabaseOpen (refNum: AGRefNum): BOOLEAN;
  261.     {$IFC NOT GENERATINGCFM}
  262.     inline
  263.         $7006, $AA6E;
  264.     {$ENDC}
  265. { AGOpen}
  266. { Open a guide database.}
  267.     function AGOpen (var fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; var resultRefNum: AGRefNum): AGErr;
  268.     {$IFC NOT GENERATINGCFM}
  269.     inline
  270.         $7001, $AA6E;
  271.     {$ENDC}
  272. { AGOpenWithSearch}
  273. { Open a guide database and preset a search string.}
  274.     function AGOpenWithSearch (var fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; searchString: ConstStr255Param; var resultRefNum: AGRefNum): AGErr;
  275.     {$IFC NOT GENERATINGCFM}
  276.     inline
  277.         $7002, $AA6E;
  278.     {$ENDC}
  279. { AGOpenWithSequence}
  280. { Open a guide database and display a presentation window sequence.}
  281.     function AGOpenWithSequence (var fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; sequenceID: INTEGER; var resultRefNum: AGRefNum): AGErr;
  282.     {$IFC NOT GENERATINGCFM}
  283.     inline
  284.         $7004, $AA6E;
  285.     {$ENDC}
  286. { AGOpenWithView}
  287. { Open a guide database and override the default view.}
  288.     function AGOpenWithView (var fileSpec: FSSpec; flags: UInt32; mixinControl: Handle; viewNum: INTEGER; var resultRefNum: AGRefNum): AGErr;
  289.     {$IFC NOT GENERATINGCFM}
  290.     inline
  291.         $7005, $AA6E;
  292.     {$ENDC}
  293. { AGQuit}
  294. { Make Apple Guide quit.}
  295.     function AGQuit: AGErr;
  296.     {$IFC NOT GENERATINGCFM}
  297.     inline
  298.         $7010, $AA6E;
  299.     {$ENDC}
  300. { AGRemoveCoachHandler}
  301. { Remove the Coach object location query handler.}
  302.     function AGRemoveCoachHandler (var resultRefNum: AGCoachRefNum): AGErr;
  303.     {$IFC NOT GENERATINGCFM}
  304.     inline
  305.         $7014, $AA6E;
  306.     {$ENDC}
  307. { AGRemoveContextHandler}
  308. { Remove the context check query handler.}
  309.     function AGRemoveContextHandler (var resultRefNum: AGContextRefNum): AGErr;
  310.     {$IFC NOT GENERATINGCFM}
  311.     inline
  312.         $7015, $AA6E;
  313.     {$ENDC}
  314. { AGStart}
  315. { Start up Apple Guide in the background.}
  316.     function AGStart: AGErr;
  317.     {$IFC NOT GENERATINGCFM}
  318.     inline
  319.         $700A, $AA6E;
  320.     {$ENDC}
  321.  
  322. { $ALIGN RESET}
  323. { $POP}
  324.  
  325. {$ENDC}
  326.  {__APPLEGUIDE__}
  327.  
  328. implementation
  329. end.
  330.